<?php

include_once($cfgPaths['lib'].'cms/type/cmsEditType.o.inc.php');

class cmsEditSelectionType extends cmsEditType {

 function registerFields () {
   $map[] = $this->name.'selection';
   $this->map = &$map;
   include($GLOBALS['cfgPaths']['etcPath']."var_selections.inc.php");
   $this->selections = $selections;
 }

 function render_html () {
  $html  = '<div class="xicstypeplugin">'."\n";
  $html .= '    <h3>'.$this->descr.':</h3>'.$this->showFields()."\n";
  $html .= '          <select name="'.$this->name.'selection" tabindex="'.$this->sender->getNextTabindex($this->name.'selection').'">'."\n";
  $value = $this->getValue($this->name.'selection');
  if (is_array($this->selections[$this->name.'selection']))
  foreach ($this->selections[$this->name.'selection'] As $sel)
  {
    $html .= '<option';
    if ($value == $sel['id'])
        $html .= ' selected="selected"';
    $html .= ' value="'.$sel['id'].'">'.$sel['value'].'</option>'."\n";
  }
  $html .= '          </select>';
  $html  .= '</div><!-- / type selection -->'."\n";
  return $html;
 }

 function render_javascript () {
 }

}


?>
